package com.kefu.boss.vo;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.boss.model.BossVersion;
import com.kefu.common.vo.AbstractSearchVo;
import io.swagger.annotations.ApiModel;
import lombok.Data;

@Data
@ApiModel
public class BossVersionSearchVo extends AbstractSearchVo {
    private String versionName;

    @Override
    public LambdaQueryWrapper lambdaQuery() {
        LambdaQueryWrapper<BossVersion> wrapper = Wrappers.lambdaQuery(BossVersion.class);
        if (StrUtil.isNotBlank(versionName)) {
            wrapper.like(BossVersion::getVersionName, versionName);
        }
        wrapper.orderByDesc(BossVersion::getCreateTime);
        return wrapper;
    }
}
